refactor: code quality cleanup pass#8
Open
ADWilkinson wants to merge 1 commit intomainfrom
Open
Conversation
Combined cleanup covering the 8 quality areas (repo is ~2400 LOC so a
single PR keeps the diff reviewable).
- dedup: extract loadPromptTemplate, readClaudeMd, getPluginFlag,
codexEffortConfig, review model/effort helpers into steps/shared.ts
(previously duplicated across plan, execute, pr, review)
- dedup: collapse buildRemoteCommandParts and buildLocalChildArgs into
a single buildPipelineArgs({ escape }) helper
- weak types: replace e.step! / e.label! / e.elapsed! in stats.ts with
isStepDone / isStepFailed type guards
- ai slop: drop a handful of restating comments in pipeline.ts and pr.ts;
keep all WHY-comments (graceful degradation, rebase race, contract header)
Assessment doc at CLEANUP_ASSESSMENT.md. No behaviour changes, no public
API changes, knip surface preserved (published as source-level contract
for oneshot-bot). Gate green: typecheck + 16 tests + build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Combined code-quality cleanup pass across all 8 review areas. Single PR because the repo is ~2400 LOC — full breakdown in
CLEANUP_ASSESSMENT.md.Dedup / DRY
src/steps/shared.tswithloadPromptTemplate,readClaudeMd,getPluginFlag,codexEffortConfig, review model/effort helpers. Previously duplicated acrossplan.ts,execute.ts,pr.ts,review.ts.buildRemoteCommandParts+buildLocalChildArgsinto a singlebuildPipelineArgs({ escape }).Weak types
e.step!/e.label!/e.elapsed!instats.tswithisStepDone/isStepFailedtype guards — non-null assertions gone, narrowed types visible.AI slop
pipeline.tsandpr.ts. Kept every real WHY comment (graceful degradation, rebase race, contract header, plugin-dir JSDoc).No action needed
knipflaggedONESHOT_STEPS,getStepShort, event types,ExecResult, etc. — all are the documented public contract mirrored byoneshot-bot/src/services/oneshot-contract.ts. KEEP.madge --circularreports none.Test plan
bun run typecheckbun test(16 pass)bun run buildmadge --circularstill clean (20 modules)